package cn.iocoder.yudao.module.crm.dal.mysql.pricetemplate;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crm.dal.dataobject.pricetemplate.PriceTemplateDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crm.controller.admin.pricetemplate.vo.*;

/**
 * 船公司收费报价模版 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PriceTemplateMapper extends BaseMapperX<PriceTemplateDO> {

    default PageResult<PriceTemplateDO> selectPage(PriceTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PriceTemplateDO>()
                .likeIfPresent(PriceTemplateDO::getCompanyName, reqVO.getCompanyName())
                .likeIfPresent(PriceTemplateDO::getCompanyCode, reqVO.getCompanyCode())
                .eqIfPresent(PriceTemplateDO::getContainerType, reqVO.getContainerType())
                .eqIfPresent(PriceTemplateDO::getShipFee, reqVO.getShipFee())
                .eqIfPresent(PriceTemplateDO::getDockFee, reqVO.getDockFee())
                .eqIfPresent(PriceTemplateDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(PriceTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PriceTemplateDO::getId));
    }

}
